Build

flags
  • --prefix  / -p

.zig-cache
  • Contains files that will make subsequent builds faster

  • These files are not intended to be checked into source-control and this directory can be completely deleted at any time with no consequences.

build.zig.zon
  • Documentation .

  • In my understanding, the file contains the pathing of dependencies to be downloaded in order to build the project.

  • When running

zig run
  • Compiles the specified source code directly into a temporary binary.

  • Runs the binary immediately after compilation.

  • Does not use the build system, that is, it doesn't process the configurations defined there.

Resolving version conflicts

Comparisons
  • 0.13.0 -> 0.14.0

    • Introduces problems in the .name  described in the build.zig.zon  file, so that names must be in the format .my_name , I think.

    • Although this can be changed in the project itself, all dependencies end up having this problem as well.

  • FunFacts!!

    • Some dependencies use a 0.14.0-dev version, so 0.13.0 is incompatible and 0.14.0 introduces problems with .name Coooool! =)

Running demos on different versions
  • Remember to use .  before the Zig path.

  • ."C:\Users\caior\apps\zig-windows-x86_64-0.14.0\zig.exe" build run

  • ."C:\Users\caior\apps\zig-windows-x86_64-0.13.0\zig.exe" build run

  • ."C:\Users\caior\apps\zig-windows-x86_64-0.12.1\zig.exe" build run